import request from "@/utils/request";

/**
 * 获取楼宇列表
 * @param { page, pageSize} params
 * @returns
 */
export function getBuildingListAPI(params) {
  return request({
    url: "/park/building",
    params,
  });
}

/**
 * 添加楼宇
 * @param {*} data
 * @returns
 */
export function createBuildingAPI(data) {
  return request({
    url: "/park/building",
    method: "POST",
    data,
  });
}

/**
 * 删除楼宇
 * @param {*} data
 * @returns
 */
export function delBuildingAPI(id) {
  return request({
    url: `/park/building/${id}`,
    method: "DELETE",
  });
}

/**
 * 获取单个楼宇详情
 * @param {*} id 
 * @returns 
 */
export function getBuildingDetailAPI(id) {
  return request.get(`/park/building/${id}`)
}

/**
 * 修改楼宇信息
 * @param {*} data 
 * @returns 
 */
export function editBuildingAPI(data) {
  return request.put("/park/building", data);
}
